<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="/header.jsp" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>原型系统</title>
<style type="text/css">
.login-main{
   width:300px;  
   height:200px;  
   position:absolute;  
   left:50%;  
   top:50%;  
   margin:-100px 0 0 -150px 
}
.layui-input-block{
margin-left:0px;
margin-top: 10px;
}
</style>
<script type="text/javascript">
if (window != top){
	top.location.href = location.href; 
}
</script>
</head>
<body>
   <div class="login-main"> 
    <header class="layui-elip">后台登录</header>
    <form class="layui-form" method="post" action="">
        <div class="layui-input-block">
            <input type="text" name="username" id="userAccount" required  lay-verify="required" placeholder="用户名" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-input-block">
            <input type="password" name="password" required  lay-verify="required" placeholder="密码" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-input-block" style="position: relative;">
            <input type="input" name="jcaptchaCode" required  lay-verify="required" placeholder="验证码" autocomplete="off" class="layui-input"/>
            <img  src="${base}images/spinner.gif" title="点击刷新"   id="img" class="layui-input" style="cursor: pointer;position:absolute;right:0px;top:0px;width:100px;"/>
        </div>
        <div class="layui-input-block" style="position: relative;">
        <input type="checkbox" name="rememberMe" title="自动登录（一个月）"/>
        </div>
        <div class="layui-input-block">
            <button type="submit" class="layui-btn " style="width:100%;">登录</button>
        </div>
         <div class="layui-input-block" id="loginInfo" style="color:#FF5722;"></div>
    </form>
</div>
<script type="text/javascript">
    layui.use(['form','layer'], function () {
        var form = layui.form(), $ = layui.jquery;
        var index=0;
        $("#img").bind("click",function refreshImg(){
        	 $("#img").attr("src","${base}images/spinner.gif");
        	 $("#img").attr("src","${base}/jcaptcha.jpg?"+(index++));
        });
        $("#img").click();
       	 $(window).keydown(function(e){
       		   if(e.keyCode==13)
       		     login();
       	  });
       	  if('${error}'){
       	    $("#loginInfo").html("${error}");
       	  }
       	  $("#userAccount").focus();
    });
</script>        
</body>
</html>